/*
 * OPIAM Suite
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */

package opiam.admin.faare.unittests.config;

import opiam.admin.faare.unittests.TestResult;
import opiam.admin.faare.unittests.TestUtils;
import opiam.admin.faare.unittests.config.javabeans.PackageConfigJavabeansTest;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

import org.apache.log4j.Logger;


/**
 * Executes all the class tests of the config package.
 */
public class PackageConfigTest extends TestCase
{
    /** Instance of logger. */
    private static Logger _logger = Logger.getLogger(PackageConfigTest.class);

    /** Instance of the trace class. */
    private static TestUtils _test = new TestUtils(_logger);

    /**
     * Creates a new PackageConfigTest object.
     *
     * @param param  Parameter.
     */
    public PackageConfigTest(String param)
    {
        super(param);
    }

    /**
     * Method of the tests suite.
     *
     * @return Tests result.
     */
    public static Test suite()
    {
        TestSuite suite = new TestSuite();

        suite.addTest(new PackageConfigTest("testBegin"));

        suite.addTest(AclsConfigTest.suite());

        //suite.addTest(ExportsConfigTest.suite());
        suite.addTest(PersistenceConfigTest.suite());
        suite.addTest(ProfilesConfigTest.suite());
        suite.addTest(ReferenceListConfigTest.suite());
        suite.addTest(TriggersConfigTest.suite());
        suite.addTest(ViewsConfigTest.suite());

        suite.addTest(PackageConfigJavabeansTest.suite());

        suite.addTest(new PackageConfigTest("testEnd"));

        return suite;
    }

    /**
     * Main method.
     * @param args Command line arguments.
     */
    public static void main(String[] args)
    {
        junit.textui.TestRunner.run(suite());
    }

    /**
     * Method to indicate the beginning of the class test.
     *
     */
    public static void testBegin()
    {
        //  To initialize the tests statement
        TestResult.getInstance().setInitiator("PackageConfigTest");
        assertTrue(true);
    }

    /**
     * Method to indicate the end of the class test.
     *
     */
    public static void testEnd()
    {
        assertTrue(true);
        _test.displayTestStatement("PackageConfigTest");
    }
}
